package com.micro.demo.controller;

import com.micro.demo.entities.Dept;
import com.micro.demo.service.DeptClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DeptController_Feign
{
  @Autowired
  private DeptClientService service;
 
  @RequestMapping(value = "/consumer/dept/get/{id}")
  public Dept get(@PathVariable("id") Long id)
  {
   return this.service.get(id);
  }
 
  @RequestMapping(value = "/consumer/dept/list")
  public List<Dept> list()
  {
    System.out.println("list测试");
   return this.service.list();
  }
 
  @RequestMapping(value = "/consumer/dept/add")
  public Object add(Dept dept)
  {
   return this.service.add(dept);
  }
}